import xadmin

from .models import Problem, Answer, Tag, Comment


class ProblemAdmin(object):
    list_display = ['title', 'categroy', 'user', 'brief', 'detail', 'add_time']
    list_filter = ['title', 'categroy', 'user', 'brief', 'detail', ]
    search_fields = ['title', 'categroy', 'user', 'brief', 'detail']
    # model_icon='fa '


class AnswerAdmin(object):
    list_display = ['problem', 'user', 'content', 'add_time']
    list_filter = ['problem', 'user', 'content', ]
    search_fields = ['problem', 'user', 'content', 'add_time']
    # model_icon='fa '


class TagAdmin(object):
    list_display = ['name', 'add_time']
    list_filter = ['name']
    search_fields = ['name', 'add_time']
    # model_icon='fa '


class CommentAdmin(object):
    list_display = ['content', 'answer', 'user', 'add_time']
    list_filter = ['content', 'answer', 'user']
    search_fields = ['content', 'answer', 'user', 'add_time']
    # model_icon='fa '


xadmin.site.register(Problem, ProblemAdmin)
xadmin.site.register(Answer, AnswerAdmin)
xadmin.site.register(Tag, TagAdmin)
xadmin.site.register(Comment, CommentAdmin)
